package project1.service;

import project1.Main;
import project1.dao.BookDao;
import project1.dao.BookDaoImpl;
import project1.entity.Book;

public class WalkServiceImpl implements WalkService {

    private static final BookDao bookDao = new BookDaoImpl();

    @Override
    public void showBook() {
        System.out.println("请输入书籍编号：");
        String id = Main.scanner.next();
        Book book = bookDao.query(id);
        System.out.println(book);
    }

    @Override
    public void showBooks() {
        Book[] books = bookDao.query();
        for (Book book : books) {
            System.out.println(book);
        }
    }
}
